-- @owner:魏亚军
-- @date:2023-12-26
-- @testpoint:3.测试在事务中修改序列缓存值

--step1:创建一个普通序列，cache值为1，其他属性默认;expect:成功(1 row)
drop sequence if exists seqopengauss_alter_sequence_cache_case0003_1;
create sequence seqopengauss_alter_sequence_cache_case0003_1 cache 1;

--step2:查看设置是否生效;expect:成功(1 row)
select cache_value from seqopengauss_alter_sequence_cache_case0003_1;

--step3:修改序列cahce值为5;expect:成功
begin;
alter sequence seqopengauss_alter_sequence_cache_case0003_1 cache 5;
end;
/

--step4:查看修改是否生效;expect:成功(1 row)
select cache_value from seqopengauss_alter_sequence_cache_case0003_1;

--step5:修改序列cahce值为3;expect:成功
begin;
alter sequence seqopengauss_alter_sequence_cache_case0003_1 cache 3;
--step6:提交事务;expect:成功
end;
/

--step7:查看修改是否有效;expect:成功(1 row)
select cache_value from seqopengauss_alter_sequence_cache_case0003_1;

--step8:清理环境:expect:成功(1 row)
drop sequence seqopengauss_alter_sequence_cache_case0003_1;